<!DOCTYPE html> 
<html lang="en"> 
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<script src="https://unpkg.com/vue@3"></script>
	<!-- import CSS -->
	<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
	<!-- import JavaScript -->
	<script src="https://unpkg.com/element-plus"></script>
<style>
		body {
			margin: 10;
			font-size: 100%;
			line-height: 1.5;
		}

		.blue-button {
			background: #25A6E1;
			padding: 3px 20px;
			color: #fff;
			font-size: 10px;
			border-radius: 2px;
			-moz-border-radius: 2px;
			-webkit-border-radius: 4px;
			border: 1px solid #1A87B9
		}

		table {
			width: 66%;
		}

		th {
			background: SteelBlue;
			color: white;
		}

		td,
		th {
			border: 1px solid gray;
			font-size: 12px;
			text-align: center;
			padding: 5px 10px;
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;
			max-width: 200px;
			white-space: nowrap;
			text-overflow: ellipsis;
			text-overflow: ellipsis;
		}
	</style>
</head>
<title>Git代码下载神器</title>
<script type="text/javascript">
function formReset() {
	document.getElementById("name").value = '';
}
</script>
<body>
	<div id="app" align="center">
		<el-button @click="open('http://118.178.86.130:8081')" type="primary">CSDN-Reader</el-button>
		<el-button @click="open('/text/')" type="primary">文本留存</el-button>
		<el-button @click="open('/git')" type="primary">git代码下载</el-button>
		<el-button @click="open('/tls')" type="primary">tls证书下载</el-button>
		<el-button @click="open('/404/')" type="danger">出错页面</el-button>
		<el-button @click="open('/doc.html')" type="success">ApiDoc</el-button>
		<p></p>
	</div>
	<form method="get" action="/git">
		<table align="center">
			<tr>
				<th style="text-align:left">项目搜索</th>
			</tr>
			<tr>
				<td>
				 关键字：
				 <input name="name" id="name" size="30" maxlength="30" value="${name}"/>
				 <input type="submit" class="blue-button" />
				 <input type="button" class="blue-button" value="清空" onclick="formReset()"/>
				</td>
			</tr>
		</table>
	</form>
	<h3  align="center"><font color="red"><#if name??>项目关键字：${name}  ，</#if>共 ${names?size} 条记录!</font></h3>
	<table align="center">
		<tr>
		<th width="5">序号</th> 
		<th width="100">链接</th>
		<th width="100">说明</th>
	</tr>
	<#list names as it>
		<tr>
			<td>${it_index+1}</td> 
			<td style="text-align:left"><a href="/git/down?name=${it!}" title="点击下载 ${it!}">${it!}</a></td>
			<td><#if it?contains('/')><font color="red">2级子项目</font></#if></td>
		</tr>
	</#list>
	</table>
	<script>
		const App = {
			methods: {
				open(url) {
					if(url.length<8){
					  window.location=url;
					}
					else {
					  window.open(url);
					}
				}
			}
		};
		const app = Vue.createApp(App);
		app.use(ElementPlus);
		app.mount("#app");
	</script>
</body>
</html>
